home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tp_dmx20.zip / DMXAMPLE.PAS < prev    next >
Pascal/Delphi Source File  |  1990-01-15  |  2KB  |  51 lines

  1. Program DMXAMPLE;
  2.  
  3. { This is the example described in the READ.ME file.
  4.   It uses no file I/O, and therefore cannot save the data.
  5.   The entire database is kept in a memory array.
  6.  
  7.   The DataArray is defined as data type DataRec, but you may notice
  8.   that it is the format string passed to DMXa.Init that determines
  9.   how the database is formatted.
  10.  
  11.   The integer field is given a 'iiii' description.  This means that
  12.   negative numbers cannot be entered.  Changing the case to all upper
  13.   case, will change this to allow both positive and negative numbers.
  14.   Changing all the 'R's to lowercase will force positive at the real
  15.   number field as well.
  16.  
  17.   Likewise, the underline characters ('_') can be changed to '^'s.
  18.   This will force all strings to be entered in uppercase only.
  19.   (This would not affect data that is already entered.)
  20.  
  21.   Just ensure that every field is separated by a '|'.
  22.  }
  23.  
  24. uses Crt, DMX2;
  25.  
  26. type DataRec    = record
  27.                     S :string [20];  I :integer;  R :real;
  28.                   end;
  29.  
  30. var  Key,ext    : char;
  31.      DataArray  : array [0..99] of DataRec;
  32.      DMXa       : DMXwindow;  { the data entry object }
  33.  
  34. Begin
  35.   ClrScr;
  36.   Window (19,2,69,22);
  37.   FillChar (DataArray, sizeof (DataArray), 0);  { clear the data }
  38.  
  39.   DMXa.Init (' Name                    ref      balance    ',
  40.              ' ____________________ | iiii | ($RRR,RRR.RR) ',
  41.              {     string [20]      integer      real      }
  42.               2,1, Cyan,LightCyan,$3F);
  43.  
  44.   DMXa.OpenBuffer (DataArray, sizeof (DataArray));
  45.  
  46.   DMXa.EditData (DataArray, Key,ext, [#27],[]);
  47.  
  48.   ClrScr;
  49. End.
  50.  
  51.